<!--
 * @Author: Shber
 * @Date: 2024-06-27 11:34:57
 * @LastEditors: Shber
 * @LastEditTime: 2024-07-01 18:24:43
 * @Description: 顶部导航
 
-->
<template>
  <tm-navbar title="标题导航栏" color="primary" linear="right" linearDeep="accent">
    <template v-slot:left>
      标题导航栏
    </template>
    <template v-slot:right>
      <tm-icon _class="px-32" name="tmicon-plus"></tm-icon>
    </template>
  </tm-navbar>
</template>
<script setup>
  import { reactive, ref, watch } from 'vue'
  import tools from '@/utils/tools'
  import myIcon from '@/components/MyIcon/index.vue'

  const activeColor = ref('#2DAED6')
  const emits = defineEmits(['update:modelValue', 'onSubmit'])
  const props = defineProps({
    active: { // 选中项
      type: Number,
      default: 0,
    }
  })
  let tabInfo = reactive([
    {label:'查订单', icon:'myicon-dingdan-e6b5', link:'/pages/order/index'},
    {label:'档案信息', icon:'myicon-cunmindangan-e623', link:''},
    {label:'', link:''},
    {label:'数据统计', icon:'myicon-shujutongji-e60a', link:''},
    {label:'我的', icon:'myicon-icon7-e663', link:''}
  ])
  const isActive = ref(0)
  watch(()=>props.active, (newVal)=>{
    isActive.value = newVal
  })

  const switchTab = (item, i)=>{
    isActive.value = i
  }
  function laodingfun(val) {
    return new Promise((res) => {
      setTimeout(function () {
        console.log('选中了：', val)
        res(true)
      }, 2000)
    })
  }

</script>
<style lang="scss" scoped>
// .icon_img{width: 50px; height: 50px;}
</style>